package la.renzhen.rtpt.config;

import java.lang.reflect.Type;
import java.util.Map;

public interface ConfigurationProvider {

    Map<String, String> allConfiguration();

    String getProperty(String key);

    default <T> T getProperty(String key, Class<T> type, String defaultValue) {
        return getProperty(key, (Type) type, defaultValue);
    }

    default <T> T getProperty(String key, Class<T> type) {
        return getProperty(key, (Type) type);
    }

    <T> T getProperty(String key, Type type, String defaultValue);

    default <T> T getProperty(String key, Type type) {
        return getProperty(key, type, null);
    }

    <T> T invoke(Class<T> configurationClass);
}
